package com.bbb.common.exception;


import com.bbb.common.Code;

/**
 * 全局异常
 */
public class ServiceException extends RuntimeException {
    private static final long serialVersionUID = 2359767895161832954L;
    private final Integer resultCode;

    public ServiceException(String message) {
        super(message);
        this.resultCode = Code.ERR;
    }

    public ServiceException(Integer resultCode) {
        this.resultCode = resultCode;
    }

    public ServiceException(Integer resultCode, Throwable cause) {
        super(cause);
        this.resultCode = resultCode;
    }

    public Throwable fillInStackTrace() {
        return this;
    }

    public Throwable doFillInStackTrace() {
        return super.fillInStackTrace();
    }

    public Integer getResultCode() {
        return this.resultCode;
    }
}
